package com.qd.system.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("sys_menu")
public class Menu extends Model<Menu> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "menu_id", type = IdType.ASSIGN_ID)
    private String menuId;
    /**
     * 父级菜单ID
     */
    @TableField("parent_id")
    private String parentId;
    /**
     * 菜单编码
     */
    @TableField("menu_code")
    private String menuCode;
    /**
     * 菜单名称
     */
    @TableField("menu_name")
    private String menuName;
    /**
     * 显示顺序
     */
    @TableField("order_num")
    private Integer orderNum;
    /**
     * 菜单URL
     */
    @TableField(updateStrategy = FieldStrategy.ALWAYS, value = "menu_url")
    private String menuUrl;
    /**
     * 菜单图标
     */
    @TableField(updateStrategy = FieldStrategy.ALWAYS, value = "menu_icon")
    private String menuIcon;
    /**
     * 菜单状态:0正常 1停用
     */
    @TableField("menu_status")
    private Integer menuStatus;
    /**
     * 权限标识
     */
    @TableField("perms")
    private String perms;
    /**
     * 组件路径
     */
    @TableField(updateStrategy = FieldStrategy.ALWAYS, value = "component")
    private String component;
    /**
     * 添加时间
     */
    @TableField("add_time")
    private LocalDateTime addTime;
    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;
    /**
     * 菜单类型
     */
    @TableField("menu_type")
    private String menuType;
    /**
     * 显示状态
     */
    @TableField("visible")
    private String visible;
    /**
     * 是否外链
     */
    @TableField(updateStrategy = FieldStrategy.ALWAYS, value = "is_frame")
    private String isFrame;
    /**
     * 按钮类型
     */
    @TableField(updateStrategy = FieldStrategy.ALWAYS, value = "button_type")
    private String buttonType;
    /**
     * 扩展字段
     */
    @TableField("extended_Field")
    private String extendedField;

    public void freeData() {
        this.menuId = null;
        this.parentId = null;
        this.menuCode = null;
        this.menuName = null;
        this.orderNum = null;
        this.menuUrl = null;
        this.menuIcon = null;
        this.menuStatus = null;
        this.perms = null;
        this.component = null;
        this.addTime = null;
        this.updateTime = null;
        this.menuType = null;
        this.visible = null;
        this.isFrame = null;
        this.buttonType = null;
        this.extendedField = null;
    }

}
